<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-for指令</title>
    <script src ="./js/vue.js"></script>
</head>
<body>
    <dir id="app">
        <h1>{{msg}}</h1>
        <ul>
            <li v-for="item in stringList">
                {{item.name}}
            </li>
        </ul>
        <ul>
            <li v-for="(item,index) in stringList" :key="index">
               {{index}}--{{name}}--{{item.name}}
            </li>
        </ul>
        <br>
        <p v-for=" (item,name,index) in user" :key="index">
           {{index}}:{{name}}:{{item}}
        </p>
    </dir>
</body>
</html>
<script> 
    let app = new Vue({
        el: '#app',
        data: {
            msg:'v-for指令',
            stringList:[
                {name:'张三'},
                {name:'李四'},
                {name:'王五'}
            ],
            user:{
                name:'张三',
                age:18,
                sex:'男',
                address:'上海'

            }

        }
    })
</script>